# Makefile for d2-ascii
#	Bogdan Filipchuk

NAME = d2-ascii
VER = 0.0.1


# Files Setup
SOURCES = $(wildcard src/*.cpp)
OBJECTS = $(addprefix obj/,$(notdir $(SOURCES:.cpp=.o)))
PROGRAM = ./bin/$(NAME)-$(VER)

# Settings
CC = g++
CFLAGS = -c -Wall `sdl-config --cflags`
LDFLAGS = `sdl-config --libs`

# LINK and COMPILES
LINK = $(CC) $(LDFLAGS)
COMPILE = $(CC) $(CFLAGS) -c

# Makefile Body

default: $(EXECUTABLE)
	echo "Creating $(EXECUTABLE) ..."

$(EXECUTABLE): $(OBJECTS)
	$(LINK) -o $@ $<

obj/%.o: src/%.cpp
	$(COMPILE) -o $@ $<

clean: 
	rm -f ./obj/*.o
	rm -f $(EXECUTABLE)
